package probando;


import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author lab_a112
 */
public class leerescribirxml {

	public void xml() throws ParserConfigurationException {
		try {
			// Lectura de fichero_origen.xml
            Main t= new Main();

			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
			//Document documento = builder.parse(new File("fichero_origen.xml"));
            // Ahora documento es el XML leido en memoria.

			// Escritura de fichero_destino.xml
			TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
			//DOMSource source = new DOMSource(documento);
            //StreamResult result = new StreamResult(new File("fichero_destino.xml"));
			//transformer.transform(source, result);




        }
        catch(Exception e){
            e.printStackTrace();

        }
    }

}
